
function request(url, data, method) {
  return new Promise((resolve, reject) => {
    tt.request({
      url: url,
      data,
      method,
      header: {
        'Content-Type': 'application/json',
        'token': tt.getStorageSync('token')
      },
      success(res) {
        resolve(res.data);
      },
      fail(err) {
        reject(err);
      }
    });
  });
}

module.exports = request;
